home *** CD-ROM | disk | FTP | other *** search
/ QuickTime 2.0 Developer Kit / QuickTime 2.0 Developer Kit.iso / mac / MAC / Programming Stuff / Interfaces / CIncludes / stdarg.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-11-21  |  635 b   |  31 lines  |  [TEXT/MPS ]

  1. /*
  2.     StdArg.h -- Variable arguments
  3.     
  4.     Copyright Apple Computer,Inc.    1987, 1990, 1994
  5.     All rights reserved.
  6.  
  7. */
  8.  
  9.  
  10. #ifndef __STDARG__
  11. #define __STDARG__
  12.  
  13. #ifndef __va_list__
  14. #define __va_list__
  15. typedef char *va_list;
  16. #endif
  17.  
  18. #ifndef __SC__
  19.     /*    most normal compilers are long-word aligned…  */
  20.     #define va_start(ap, parmN) ap = (va_list)((unsigned int)&(parmN) + (((sizeof(parmN)+3)/4)*4))
  21. #else
  22.     /*    …but Symantec C is word aligned.  */
  23.     #define va_start(ap, parmN) ap = (va_list)((char*)&parmN + (((sizeof(parmN)+1)/2)*2))
  24. #endif
  25.  
  26. #define va_arg(ap, type) ((type *)(ap += sizeof (type)))[-1]
  27. #define va_end(ap)    /* do nothing */
  28.  
  29.  
  30. #endif
  31.